package com.cw.controller;

import com.cw.beans.State;
import com.cw.mapper.StateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class StateController {
    @Autowired
    private StateMapper stateMapper;

    //ajax获取状态的下拉列表回显
    @ResponseBody
    @RequestMapping("/getState")
    public List<State> getState() {
        List<State> stateList = stateMapper.getState();
        System.out.println(stateList);
        return stateList;
    }
}
